<?php
class VipcardAction extends CommonAction{
	
	
	/**
	 * 领取基础会员卡
	 */
	public function index() {
		
		if(!$_SESSION[C('USER_AUTH_KEY')]){
			redirect(U(C('USER_AUTH_GATEWAY')));
		}
		
		$model = D("Actvipcard");
		
		if(IS_POST){
			
			$map['userid'] = session(C('USER_AUTH_KEY'));
			$map['mobile'] = session(C('USER_AUTH_ACCOUNT'));
			$json = sendRest("Vip/get", $map);
			if($json['status'] == 1){
				$this->success("领取会员卡成功",U("Member/vip_index"));
			}else{
				$this->error($json['info']);
			}
		}else{
			$json = $model->getBaseVipcard();
			$this->assign("detail",$json);
			
			$this->display();
		}
	}
	
}
?>